<template>
  <div>
    <div style="text-align: end; margin-right: 20px">
      <el-button type="primary"
                 @click="dialogFormVisible = true">新增监控</el-button>
    </div>
    <el-table :data="tableData"
              style="width: 100%">
      <el-table-column prop="videonum"
                       label="编号"
                       width="180"></el-table-column>
      <el-table-column prop="videoname"
                       label="监控名称"
                       width="180"></el-table-column>
      <el-table-column prop="time"
                       label="添加时间"></el-table-column>
      <el-table-column prop="class"
                       label="操作"
                       width="100">
        <template slot-scope="scope">
          <el-button style="font-size: 20px"
                     icon="el-icon-search"
                     @click="handleClick(scope.row)"
                     type="text"
                     size="small"></el-button>
        </template>
      </el-table-column>
    </el-table>

    <!--        新建监控-->
    <el-dialog title="新建监控"
               :visible.sync="dialogFormVisible"
               width="60vw">
      <el-form class="new-channel-dialog"
               label-position="top"
               label-width="70px"
               style="overflow: hidden">
        <div>
          <el-form-item label="RTMP地址">
            <el-input autocomplete="off"></el-input>
          </el-form-item>
          <el-form-item label="HLS地址">
            <el-input autocomplete="off"></el-input>
          </el-form-item>
          <el-form-item label="设备序列号">
            <el-input autocomplete="off"></el-input>
          </el-form-item>
          <el-form-item label="监控名称">
            <el-input autocomplete="off"></el-input>
          </el-form-item>
        </div>
        <div style="margin-left: 20px">
          <div class="stu-img"
               style></div>
          <el-form-item label="监控地址">
            <el-input autocomplete="off"></el-input>
          </el-form-item>
          <div class="map-img">
            <vedio-map></vedio-map>
          </div>
          <el-form-item label="安装位置">
            <el-input autocomplete="off"></el-input>
          </el-form-item>
        </div>
      </el-form>
      <div slot="footer"
           class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary"
                   @click="dialogFormVisible = false">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import VedioMap from "./components/VedioMap";
export default {
  name: 'ChannelConfig',
  data () {
    return {
      dialogFormVisible: false,
      value: '',
      tableData: [
        {
          videonum: 'sc349784957485001',
          videoname: '学校正门',
          time: '2020-13-27 18：25',
        },
      ],
    };
  },

  components: {
    VedioMap,
  },
};
</script>

<style scoped>
.el-input {
  width: 20vw;
}
.new-channel-dialog {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.map-img {
  height: 200px;
  width: 20vw;
}
</style>
